<!--
 * @Descripttion:
 * @Author: Silence
 * @Date: 2023-05-27 16:15:27
 * @LastEditors: Silence
 * @LastEditTime: 2023-05-30 20:37:37
-->
<template>
  <div class="article-detail-page" v-if="article.id">
    <nav class="nav">
      <span class="back" @click="$router.back()">&lt;</span> 面经详情
    </nav>
    <header class="header">
      <h1>{{ article.stem }}</h1>
      <p>
        {{ article.createdAt }} | {{ article.views }} 浏览量 |
        {{ article.likeCount }} 点赞数
      </p>
      <p>
        <img :src="article.creatorAvatar" alt="" />
        <span>{{ article.creatorName }}</span>
      </p>
    </header>
    <main class="body">{{ article.content }}</main>
  </div>
</template>
<script>
import axios from 'axios'
export default {
  name: '',
  data () {
    return {
      article: {}
    }
  },
  created () {
    this.getDetail()
  },
  computed: {
  },
  methods: {
    async getDetail () {
      const res = await axios.get('https://mock.boxuegu.com/mock/3083/articles/' + this.$route.params.id)
      this.article = res.data.result
    }
  }
}
</script>
<style lang='less'  scoped>
</style>
